<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Secure Banking</title>
</head>
<body>

<%@page import="java.sql.*"%>
<%@page import="java.util.*" %>
<%@page import="java.security.KeyFactory"%>
<%@page import="java.security.Key" %> 
<%@page import="java.security.KeyPairGenerator"%>
<%@page import="java.security.KeyPair"%>
<%@page import="java.security.spec.RSAPublicKeySpec" %>
<%@page import="java.security.spec.RSAPrivateKeySpec" %>
<%@page import="javax.crypto.Cipher"%>
<%@page import="java.io.*"%>
<%

String name=request.getParameter("c1");
System.out.println(name);
int acno=Integer.parseInt(request.getParameter("c2"));
String branch=request.getParameter("c3");
 System.out.println(branch);
String actype=request.getParameter("c4");
System.out.println(actype);
String dob=request.getParameter("c5");
System.out.println(dob);
int gender=Integer.parseInt(request.getParameter("c6"));
System.out.println(gender);
String address=request.getParameter("c7");
System.out.println(address);
String feedback=request.getParameter("c8");
System.out.println(feedback);
String city=request.getParameter("c9");
System.out.println(city);
String state=request.getParameter("c10");
System.out.println(state);
String email=request.getParameter("c11");
int phno=Integer.parseInt(request.getParameter("c12"));
String ocupation=request.getParameter("c13");
String squest=request.getParameter("c14");
String sans=request.getParameter("c15");
int pin=Integer.parseInt(request.getParameter("c16"));
System.out.println("all  r inserted");

try{
	
	Class.forName("oracle.jdbc.driver.OracleDriver");
	Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","bank","bank");
	System.out.println("connection created");
	Statement st=con.createStatement();
	PreparedStatement pstmt=con.prepareStatement("insert into checkbook values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
	System.out.println("sattement created");
    //st.executeUpdate("insert into checkbook values(name='"+name+"',accno="+acno+",branch='"+branch+"',acctype='"+actype+"',dob='"+dob+"',gender="+gender+",pincode="+pincode+",address='"+address+"',city='"+city+"',state='"+state+"',email='"+email+"',phno="+phno+",occupation='"+ocupation+"',squest='"+squest+"',sans='"+sans+"',pin="+pin+")");
	pstmt.setString(1,name);
	pstmt.setInt(2,acno);
	pstmt.setString(3,branch);
	pstmt.setString(4,actype);
	pstmt.setString(5,dob);
	pstmt.setInt(6,gender);
	pstmt.setString(7,feedback);
	pstmt.setString(8,address);
	pstmt.setString(9,city);
	pstmt.setString(10,state);
	pstmt.setString(11,email);
	pstmt.setInt(12,phno);
	pstmt.setString(13,ocupation);
	pstmt.setString(14,squest);
	pstmt.setString(15,sans);
	pstmt.setInt(16,pin);
	pstmt.executeUpdate();
	System.out.println("Allare inserted");
}
catch(Exception e){}
	
	
%>
<jsp:forward page=""/>
</body>
</html>